<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;
/**
 * 抓取郵件地址記錄
 */
class Crawls extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'crawls';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    // 刪除字段
    protected $deleteTime = 'deleted';

    // 追加属性
    protected $append = [
        'key'
    ];
    public function getKeyAttr($v,$data){
        return time().rand(10000000,9999999)."-".$data['id'];
    }
}
